<?php

namespace frontend\models;

use bc\ar\DActiveRecord;


class UserSource extends DActiveRecord
{
	
	/**
	 * 定义数据表
	 */
	public static function tableName()
	{
		return 'bc_user_source'; 
	}
	
	/**
	 * 根据openid获取用户来源
	 */
	public function getOpenid($openid) {
		$where = array(
			'openid' => $openid	
		);
		return static::findOne($where);
	}
	
// 	public  static function getTableName()
// 	{
// 		return Yii::$app->db_pms;
// 	}
	
}